﻿using AspDotNet.Core3.Mvc.Study.ProductDemo.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace AspDotNet.Core3.Mvc.Study.ProductDemo.Controllers
{
    public class HomeController : Controller
    {
        IProductOperation productOperation = null;
        public HomeController(IProductOperation operation)
        {
            this.productOperation = operation;
        }
        public IActionResult Index()
        {
            return Json(this.productOperation.GetProducts());
        }

        public ObjectResult ObjResult()
        {
            return new ObjectResult(this.productOperation.GetProducts());
        }
        public IActionResult HelloMvc()
        {
            return View();
        }
    }
}
